package com.zhang.modules.mianShi.rep;

import com.zhang.common.jpa.rep.BaseRep;
import com.zhang.modules.mianShi.entity.AppSystem;
import com.zhang.modules.mianShi.entity.dto.appSystem.AppSystemDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppSystemRep extends BaseRep<AppSystem,String> {


    @Query(value = "select * from app_system where region_id = ?1 and deleted = false",nativeQuery = true)
    Page<AppSystem> findAllByRegion(String regionId, Pageable pageable);

    @Query(value = "select system_name as systemName,id as id from app_system where region_id = ?1 and deleted = false",nativeQuery = true)
    List<AppSystemDto> findAllList(String regionId);
}
